.settings-modal {
  position: fixed;
  top: 0;
  left: 0;
  right: 0;
  bottom: 0;
  background-color: rgba(0, 0, 0, 0.5);
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 1000;
}

.settings-container {
  background-color: white;
  border-radius: 8px;
  width: 90%;
  max-width: 900px;
  height: 80vh;
  display: flex;
  flex-direction: column;
  box-shadow: 0 4px 20px rgba(0, 0, 0, 0.3);
}

.settings-header {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding: 20px 25px;
  border-bottom: 1px solid #e0e0e0;
}

.settings-header h2 {
  margin: 0;
  font-size: 24px;
  color: #333;
}

.close-btn {
  background: none;
  border: none;
  font-size: 32px;
  color: #666;
  cursor: pointer;
  padding: 0;
  width: 32px;
  height: 32px;
  display: flex;
  align-items: center;
  justify-content: center;
  border-radius: 4px;
  transition: all 0.2s;
}

.close-btn:hover {
  background-color: #f0f0f0;
  color: #333;
}

.settings-content {
  display: flex;
  flex: 1;
  overflow: hidden;
}

.settings-sidebar {
  width: 200px;
  background-color: #f8f9fa;
  border-right: 1px solid #e0e0e0;
  padding: 20px 0;
  overflow-y: auto;
}

.settings-sidebar button {
  width: 100%;
  padding: 12px 25px;
  background: none;
  border: none;
  text-align: left;
  cursor: pointer;
  font-size: 15px;
  color: #555;
  transition: all 0.2s;
  border-left: 3px solid transparent;
}

.settings-sidebar button:hover {
  background-color: #e9ecef;
  color: #333;
}

.settings-sidebar button.active {
  background-color: #fff;
  color: #007bff;
  border-left-color: #007bff;
  font-weight: 500;
}

.settings-main {
  flex: 1;
  padding: 25px;
  overflow-y: auto;
}

.settings-section {
  margin-bottom: 30px;
}

.settings-section h3 {
  margin: 0 0 20px 0;
  font-size: 18px;
  color: #333;
  padding-bottom: 10px;
  border-bottom: 2px solid #007bff;
}

.settings-item {
  margin-bottom: 20px;
  display: flex;
  flex-direction: column;
}

.settings-item label {
  font-size: 14px;
  color: #333;
  margin-bottom: 8px;
  font-weight: 500;
  display: flex;
  align-items: center;
}

.settings-item label input[type="checkbox"] {
  margin-right: 10px;
  margin-bottom: 0;
  width: 18px;
  height: 18px;
  cursor: pointer;
}

.settings-item input[type="text"],
.settings-item input[type="number"],
.settings-item select {
  padding: 10px 12px;
  border: 1px solid #ddd;
  border-radius: 4px;
  font-size: 14px;
  transition: border-color 0.2s;
  background-color: white;
}

.settings-item input[type="text"]:focus,
.settings-item input[type="number"]:focus,
.settings-item select:focus {
  outline: none;
  border-color: #007bff;
  box-shadow: 0 0 0 3px rgba(0, 123, 255, 0.1);
}

.settings-item input[type="number"] {
  width: 200px;
}

.settings-help {
  font-size: 12px;
  color: #666;
  margin-top: 5px;
  font-style: italic;
}

.settings-actions {
  display: flex;
  justify-content: space-between;
  align-items: center;
  padding-top: 20px;
  margin-top: 30px;
  border-top: 1px solid #e0e0e0;
}

.settings-left-actions,
.settings-right-actions {
  display: flex;
  gap: 10px;
}

.primary-btn,
.secondary-btn,
.danger-btn,
.import-btn {
  padding: 10px 20px;
  border: none;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.primary-btn {
  background-color: #007bff;
  color: white;
}

.primary-btn:hover {
  background-color: #0056b3;
}

.secondary-btn,
.import-btn {
  background-color: #6c757d;
  color: white;
}

.secondary-btn:hover,
.import-btn:hover {
  background-color: #5a6268;
}

.danger-btn {
  background-color: #dc3545;
  color: white;
}

.danger-btn:hover {
  background-color: #c82333;
}

.import-btn {
  display: inline-block;
}

.save-status {
  margin-top: 15px;
  padding: 12px;
  border-radius: 4px;
  font-size: 14px;
  font-weight: 500;
  text-align: center;
}

.save-status.success {
  background-color: #d4edda;
  color: #155724;
  border: 1px solid #c3e6cb;
}

.save-status.error,
.save-status.import-error {
  background-color: #f8d7da;
  color: #721c24;
  border: 1px solid #f5c6cb;
}

.save-status.reset,
.save-status.imported {
  background-color: #d1ecf1;
  color: #0c5460;
  border: 1px solid #bee5eb;
}

/* 响应式设计 */
@media (max-width: 768px) {
  .settings-container {
    width: 95%;
    height: 90vh;
  }

  .settings-content {
    flex-direction: column;
  }

  .settings-sidebar {
    width: 100%;
    border-right: none;
    border-bottom: 1px solid #e0e0e0;
    padding: 10px 0;
    display: flex;
    overflow-x: auto;
    overflow-y: hidden;
  }

  .settings-sidebar button {
    white-space: nowrap;
    padding: 10px 15px;
    border-left: none;
    border-bottom: 3px solid transparent;
  }

  .settings-sidebar button.active {
    border-left: none;
    border-bottom-color: #007bff;
  }

  .settings-main {
    padding: 15px;
  }

  .settings-actions {
    flex-direction: column;
    gap: 10px;
  }

  .settings-left-actions,
  .settings-right-actions {
    width: 100%;
    flex-direction: column;
  }

  .primary-btn,
  .secondary-btn,
  .danger-btn,
  .import-btn {
    width: 100%;
  }
}

/* 深色主题支持 */
.dark-theme .settings-container {
  background-color: #1e1e1e;
}

.dark-theme .settings-header {
  border-bottom-color: #3a3a3a;
}

.dark-theme .settings-header h2 {
  color: #e0e0e0;
}

.dark-theme .close-btn {
  color: #aaa;
}

.dark-theme .close-btn:hover {
  background-color: #2a2a2a;
  color: #fff;
}

.dark-theme .settings-sidebar {
  background-color: #252525;
  border-right-color: #3a3a3a;
}

.dark-theme .settings-sidebar button {
  color: #aaa;
}

.dark-theme .settings-sidebar button:hover {
  background-color: #2a2a2a;
  color: #e0e0e0;
}

.dark-theme .settings-sidebar button.active {
  background-color: #1e1e1e;
  color: #4da3ff;
  border-left-color: #4da3ff;
}

.dark-theme .settings-section h3 {
  color: #e0e0e0;
  border-bottom-color: #4da3ff;
}

.dark-theme .settings-item label {
  color: #e0e0e0;
}

.dark-theme .settings-item input[type="text"],
.dark-theme .settings-item input[type="number"],
.dark-theme .settings-item select {
  background-color: #2a2a2a;
  border-color: #3a3a3a;
  color: #e0e0e0;
}

.dark-theme .settings-item input[type="text"]:focus,
.dark-theme .settings-item input[type="number"]:focus,
.dark-theme .settings-item select:focus {
  border-color: #4da3ff;
  box-shadow: 0 0 0 3px rgba(77, 163, 255, 0.2);
}

.dark-theme .settings-help {
  color: #888;
}

.dark-theme .settings-actions {
  border-top-color: #3a3a3a;
}
